define(function(require, exports, module) {
  'use strict';

  var io = require('../../common/io');
  var util = require('../../common/util');

  var groups = require('./groups');
  var Form = require('./form');

  var id = util.urlParams()['id'];

  if (!id) {
    throw new Error('Need to param id!');
  }
  io.get('kmInfoView', {id:id}, function() {
    new Form({
      isEdit: true,
      formData: {
        id:id
      },
      data: {
        groups: groups(this.data)
      }
    });
  });

});
